package com.atguigu.gmall.realtime.join;

import com.atguigu.gmall.realtime.app.BaseSQLApp;
import com.atguigu.gmall.realtime.util.SQLUtil;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;

/**
 * @Author lzc
 * @Date 2023/8/2 09:08
 */
public class KafkaConsumeLeftJoin extends BaseSQLApp {
    public static void main(String[] args) {
        new KafkaConsumeLeftJoin().start(
            7777,
            2,
            "LeftJoin"
        );
    }
    
    @Override
    public void handle(StreamExecutionEnvironment env,
                       StreamTableEnvironment tEnv) {
        
        tEnv.executeSql("create table tt12(" +
                            " id string , " +
                            " name string, " +
                            " age int " +
                            ")" + SQLUtil.getKafkaSourceSQL("KafkaConsumeLeftJoin", "tt12"));
    
    
        tEnv.sqlQuery("select * from tt12").execute().print();
    
    
    }
}
